package tmp;

// Generated 04-nov-2009 18:40:40 by Hibernate Tools 3.2.4.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Profile generated by hbm2java
 */
@Entity
@Table(name = "profile", catalog = "fmanzano_gem", uniqueConstraints = @UniqueConstraint(columnNames = "PER_NAME"))
public class Profile implements java.io.Serializable {

	private Integer perId;
	private String perComments;
	private boolean perEditable;
	private String perName;
	private boolean perStatus;
	private Set<Service> services = new HashSet<Service>(0);
	private Set<InternalUser> internalUsers = new HashSet<InternalUser>(0);
	private Set<ExpedientTypePhases> expedientTypePhaseses = new HashSet<ExpedientTypePhases>(
			0);

	public Profile() {
	}

	public Profile(boolean perEditable, String perName, boolean perStatus) {
		this.perEditable = perEditable;
		this.perName = perName;
		this.perStatus = perStatus;
	}

	public Profile(String perComments, boolean perEditable, String perName,
			boolean perStatus, Set<Service> services,
			Set<InternalUser> internalUsers,
			Set<ExpedientTypePhases> expedientTypePhaseses) {
		this.perComments = perComments;
		this.perEditable = perEditable;
		this.perName = perName;
		this.perStatus = perStatus;
		this.services = services;
		this.internalUsers = internalUsers;
		this.expedientTypePhaseses = expedientTypePhaseses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "PER_ID", unique = true, nullable = false)
	public Integer getPerId() {
		return this.perId;
	}

	public void setPerId(Integer perId) {
		this.perId = perId;
	}

	@Column(name = "PER_COMMENTS", length = 100)
	public String getPerComments() {
		return this.perComments;
	}

	public void setPerComments(String perComments) {
		this.perComments = perComments;
	}

	@Column(name = "PER_EDITABLE", nullable = false)
	public boolean isPerEditable() {
		return this.perEditable;
	}

	public void setPerEditable(boolean perEditable) {
		this.perEditable = perEditable;
	}

	@Column(name = "PER_NAME", unique = true, nullable = false, length = 30)
	public String getPerName() {
		return this.perName;
	}

	public void setPerName(String perName) {
		this.perName = perName;
	}

	@Column(name = "PER_STATUS", nullable = false)
	public boolean isPerStatus() {
		return this.perStatus;
	}

	public void setPerStatus(boolean perStatus) {
		this.perStatus = perStatus;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "profile_services", catalog = "fmanzano_gem", joinColumns = { @JoinColumn(name = "PER_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "SER_ID", nullable = false, updatable = false) })
	public Set<Service> getServices() {
		return this.services;
	}

	public void setServices(Set<Service> services) {
		this.services = services;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "profile")
	public Set<InternalUser> getInternalUsers() {
		return this.internalUsers;
	}

	public void setInternalUsers(Set<InternalUser> internalUsers) {
		this.internalUsers = internalUsers;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "expedient_type_phases_profile", catalog = "fmanzano_gem", joinColumns = { @JoinColumn(name = "PER_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "FAS_ID", nullable = false, updatable = false) })
	public Set<ExpedientTypePhases> getExpedientTypePhaseses() {
		return this.expedientTypePhaseses;
	}

	public void setExpedientTypePhaseses(
			Set<ExpedientTypePhases> expedientTypePhaseses) {
		this.expedientTypePhaseses = expedientTypePhaseses;
	}

}
